/**
 * Copyright (c) 2025 myons Inc. All rights reserved.
 */
package cn.zmwh.common.security.base;

import cn.hutool.json.JSONUtil;
import cn.zmwh.common.security.pojo.dto.LoginDTO;
import cn.zmwh.common.security.pojo.request.LoginRequest;
import cn.zmwh.common.security.pojo.vo.LoginVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * @describe: 用户实现 、
 * @author: dmzmwh 、
 * @time: 2025-04-04 14:28 、
 */
public interface UserService {

    Logger logger = LoggerFactory.getLogger(UserService.class);

    /**
     * 用户查询信息，内部可做邀请 用户注册等
     *
     * @param request
     * @return
     */
    UserDetails loadUser(LoginDTO request);

    UserDetails loadUserById(Long id1);

    default boolean userStatus(Long id) {
        return true;
    }

    default void loginLog(LoginRequest request, LoginVo loginVo) {
        logger.info(request.getUserName() + "登录日志" + JSONUtil.toJsonStr(loginVo));
    }


}
